#ifndef _MOBILE_INPUT_H_
#define _MOBILE_INPUT_H_

#include <sys_config.h>
#include <types.h>
#include <basic_types.h>
#include <mediatypes.h>
#include <api/libc/printf.h>
#include <api/libc/string.h>
#include <osal/osal.h>
#include <api/libosd/osd_lib.h>

#define VACT_CAPS			(0xFE)
#define VACT_DEL			(0xFD)


typedef enum
{
	ACT_TYPE_CHAR = 0,
	ACT_TYPE_LEFT,
	ACT_TYPE_RIGHT,
	ACT_TYPE_CAPS,
	ACT_TYPE_DEL,
}ACT_TYPE;

typedef struct 
{
    UINT8   act;
    UINT8   acttype; /* See ACT_TYPE*/ 
    UINT8   map_char_count;
    char*  map_chars;
}act_map_chars_t;

typedef void (*mobile_input_callback)(UINT8* string);

typedef enum
{
	MOBILE_CAPS_INIT_LOW,
	MOBILE_CAPS_INIT_UP,
	MOBILE_CAPS_ALWAYS_LOW,
	MOBILE_CAPS_ALWAYS_UP,
}MOBILE_INPUT_CAPS_TYPE;

typedef enum
{
	MOBILE_INPUT_NORMAL,
	MOBILE_INPUT_HEX,
	MOBILE_INPUT_PWD,
}MOBILE_INPUT_METHOD_TYPE;

typedef struct
{
	MOBILE_INPUT_METHOD_TYPE	type;
	MOBILE_INPUT_CAPS_TYPE 		caps_flag;
	UINT8						maxlen;
	UINT8						fixlen_flag;
	mobile_input_callback		callback;
}mobile_input_type_t;

void 	mobile_input_init(EDIT_FIELD* edf, mobile_input_type_t* type);
PRESULT mobile_input_proc(EDIT_FIELD* edf, VACTION vact, UINT32 key, UINT32 para);

UINT8   mobile_input_get_caps(void);

#endif//_MOBILE_INPUT_H_

